feat: Enable New Architecture with react-native.config.js #2091
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Currently, to enable New Architecture, there is a need of running
RCT_NEW_ARCH_ENABLED=1 pod install
. This change introduces new param in config file:project.ios.newArchEnabled
which forces to run app with a given architecture. This change is caused by enabling pods installation inrun-ios
andbuild-ios
commands (#2077) - currently, if someone ranRCT_NEW_ARCH_ENABLED=1 pod install
and then added a package with native code, the script would disable New Arch. This PR allows to:Pods.xcodeproj/project.pbxproj
project.ios.newArchEnabled
field. In case anyone change the architecture by using a RCT_NEW_ARCH_ENABLED flag and the param in config is set, it will install the pods accordingly to the Architecture set in the configTest Plan:
run-ios
and check if project ran correctlyRCT_NEW_ARCH_ENABLED=1 pod install
andrun-ios
and verify iffabric: true
in Metro consolereact-native.config.js
with the following content:run-ios
and verifyfabric: true
is not visible in Metro logstrue
and runrun-ios
again - verifyfabric: true
is visible in Metro logsreact-native-gesture-handler
to the projectrun-ios
again, let the pods install and verifyfabric: true
is set in the Metro logspod install
inios
folder and runrun-ios
again, verify that pods are installed again andfabric: true
is visible in Metro logsChecklist